// 服务器入口文件

// http通信
// 1. 创建Koa的实例对象
const Koa = require('koa')
const app = new Koa()


// 2. 绑定中间件
const duration = require('./middleware/koa_response_duration')
app.use(duration)

const header = require('./middleware/koa_response_header')
app.use(header)

const data = require('./middleware/koa_response_data')
app.use(data)

// 3. 绑定端口号：8888
app.listen(8888)

//=========================================================================

// webSocket通信
// const webSocket = require('./service/webSocket_service')
// webSocket.listen()